/** 地图-界面层级 */
export enum MapLayerType {
  MIN = 0,
  DEFAULT,
  //
  MAX,
}

/** 界面层级 */
export enum LayerIndexType {
  MIN = 0,
  DEFAULT,
  //
  MAX,
}

export enum TipsObjectType {
  /** 飞一个小东西 */
  flyTips,
  /** 详情信息提示，点击其他地方消失 */
  miniWinTips,
  /** 飘血之类的 */
  flyText,
}

export interface ITipsObject {
  type: TipsObjectType;
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  data?: any;
  callBack?: (...args: unknown[]) => unknown;
}

/** 常用图片资源路径 */
export enum ImagePath {
  root = 'res/',
  /** 背景图片 */
  bg = root + 'bg/',
  /** 资源图片 */
  sprite = root + 'sprite/',
  /** 通用资源图片 */
  common = sprite + 'common/',
  /** 通用资源图片 */
  /** 通用按钮图片 */
  button = common + 'button/',
  /** 通用icon */
  icon = common + 'button/',
}

// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace GameEventType {
  export const MAIN_PANEL_CONTROL_PLAYER = 'MAIN_PANEL_CONTROL_PLAYER';
  export const MAIN_PANEL_CONTROL_MONSTER = 'MAIN_PANEL_CONTROL_MONSTER';
}

/** 自定义事件 */
export enum EventType {
  LOGIN = 'LOGIN',

  REFRESH_COIN = 'REFRESH_COIN',
  REFRESH_ENERGY = 'REFRESH_ENERGY',

  SHOW_MOUSE_CTRL = 'SHOW_MOUSE_CTRL',

  AD_COIN = 'AD_COIN',
  AD_ENERGY = 'AD_ENERGY',
  AD_GETITEM = 'AD_GETITEM',
  AD_REVIVE = 'AD_REVIVE',
  AD_GRID = 'AD_GRID',
  AD_VISITOR = 'AD_VISITOR',

  SHARE_COIN = 'SHARE_COIN',
  SHARE_ENERGY = 'SHARE_ENERGY',

  CREATE_FLY_COLOR = 'CREATE_FLY_COLOR',
}

/** 分享事件 */
export enum ShareEvent {
  Coin = 'coin',
  Energy = 'energy',
}

/** 对象池键值 */
export enum PoolElementType {
  GRID_ITEM = 'GridItem',
  COLOR_ITEM = 'ColorItem',
  PROP_ITEM = 'PropItem',
  VISITOR_ITEM = 'VisitorItem',
  LEVEL_ITEM = 'LevelItem',
}

export class RollItem {
  /** id */
  id: number;
  /** 权重 */
  widget: number;
  /** 携带数据 */
  data: unknown;

  constructor(_id: number, _widget: number, _data: unknown = null) {
    this.id = _id;
    this.widget = _widget;
    this.data = _data;
  }
}

// /** 日志操作类型 */
// export enum OperationType {
//   /** 加值 */
//   ADD = 'ADD',
//   /** 乘值 */
//   MULTIPLE = 'MULTIPLE',
// }

/** 自定义事件 */
export enum CustomsEvent {
  /** 隐藏所有pick选框 */
  HIDE_PICK_SELECT = 'HIDE_PICK_SELECT',
}

export enum GameState {
  READY = 'Ready',
  PLAYING = 'Playing',
  PAUSE = 'PAUSE',
}
